package com.leoman.spinningmachine.shake;

import android.app.Activity;
import android.os.Bundle;

import com.leoman.helper.util.LogUtil;

public class TestActivity extends Activity {

//	/** 手掌上部分 */
//	private RelativeLayout mImgUp;
//
//	/** 手掌下部分 */
//	private RelativeLayout mImgDn;
//
//	/** 手掌上部分边线 */
//	private LinearLayout mImgUpLine;
//
//	/** 手掌下部分边线 */
//	private LinearLayout mImgDnLine;
//
//	/** 摇一摇结果view */
//	private RelativeLayout mResultayout;
//	private ImageView mResulImg;
//	private TextView mResulName;
//	private TextView mResulValue;
//	private LinearLayout mShakeLoading;

	private ShakeListener mShakeListener = null;

	public final static int RESULT_ANIM_VISIBLE_END = 100;// 结果页显示动画结束
	public final static int RESULT_ANIM_GONE_END = 101;// 结果页隐藏动画结束

	public final static int HAND_ANIM_START = 102;// 手掌动画开始
	public final static int HAND_ANIM_END = 103;// 手掌动画结束

	public final static int SET_IMG_SUC = 104;// 结果页图片设置成功

	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		initShake();
	}
	
	private void initShake() {
		NeedForSound.getInstance().addSound(this);
		mShakeListener = new ShakeListener(this);
		mShakeListener.setOnShakeListener(shakeListener);
	}

	ShakeListener.OnShakeListenerCallBack shakeListener = new ShakeListener.OnShakeListenerCallBack() {
		public void onShake() {
			LogUtil.json("开始摇起来");
//			startShakeAnim(); // 开始 摇一摇手掌动画
//			mShakeListener.stop();
//			NeedForSound.getInstance().playStartSound();
		}
	};

	@Override
	public void onResume() {
		super.onResume();
		mShakeListener.start();
	}

	@Override
	public void onPause() {
		mShakeListener.stop();
		super.onPause();
	}

	@Override
	public void onStop() {
		mShakeListener.stop();
		super.onStop();
	}


}
